from numba import jit

url_l = ['https://blog.csdn.net/weixin_32759777/article/details/105295979',
         'https://blog.csdn.net/weixin_32759777/article/details/105288597',
         'https://blog.csdn.net/weixin_32759777/article/details/105274936',
         'https://blog.csdn.net/weixin_32759777/article/details/105264904',
         'https://blog.csdn.net/weixin_32759777/article/details/105262794',
         'https://blog.csdn.net/weixin_32759777/article/details/104964601',
         'https://blog.csdn.net/weixin_32759777/article/details/105261888',
         'https://blog.csdn.net/weixin_32759777/article/details/105261544',
         'https://blog.csdn.net/weixin_32759777/article/details/105249806',
         'https://blog.csdn.net/weixin_32759777/article/details/105247567',
         'https://blog.csdn.net/weixin_32759777/article/details/105215598',
         'https://blog.csdn.net/weixin_32759777/article/details/105196433',
         'https://blog.csdn.net/weixin_32759777/article/details/105191978',
         'https://blog.csdn.net/weixin_32759777/article/details/105149916',
         'https://blog.csdn.net/weixin_32759777/article/details/105123306',
         'https://blog.csdn.net/weixin_32759777/article/details/105135198',
         'https://blog.csdn.net/weixin_32759777/article/details/105134677',
         'https://blog.csdn.net/weixin_32759777/article/details/105133955',
         'https://blog.csdn.net/weixin_32759777/article/details/105133623',
         'https://blog.csdn.net/weixin_32759777/article/details/105133481',
         "https://blog.csdn.net/weixin_32759777/article/details/105105692",
         "https://blog.csdn.net/weixin_32759777/article/details/105079178",
         'https://blog.csdn.net/weixin_32759777/article/details/82120150',
         'https://blog.csdn.net/weixin_32759777/article/details/104856214',
         'https://blog.csdn.net/weixin_32759777/article/details/104267607',
         'https://blog.csdn.net/weixin_32759777/article/details/104537581',
         'https://blog.csdn.net/weixin_32759777/article/details/86912355',
         'https://blog.csdn.net/weixin_32759777/article/details/104658869',
         'https://blog.csdn.net/weixin_32759777/article/details/91932253',
         'https://blog.csdn.net/weixin_32759777/article/details/89310981',
         'https://blog.csdn.net/weixin_32759777/article/details/84998266',
         'https://blog.csdn.net/weixin_32759777/article/details/92773083',
         'https://blog.csdn.net/weixin_32759777/article/details/83508197',
         'https://blog.csdn.net/weixin_32759777/article/details/102792481',
         'https://blog.csdn.net/weixin_32759777/article/details/82747572',
         'https://blog.csdn.net/weixin_32759777/article/details/85138021',
         'https://blog.csdn.net/weixin_32759777/article/details/93640433',
         'https://blog.csdn.net/weixin_32759777/article/details/104917515',
         'https://blog.csdn.net/weixin_32759777/article/details/82120099',
         'https://blog.csdn.net/weixin_32759777/article/details/85043790',
         'https://blog.csdn.net/weixin_32759777/article/details/89356809',
         'https://blog.csdn.net/weixin_32759777/article/details/104485898',
         'https://blog.csdn.net/weixin_32759777/article/details/103831979',
         'https://blog.csdn.net/weixin_32759777/article/details/104068507',
         'https://blog.csdn.net/weixin_32759777/article/details/89308788',
         'https://blog.csdn.net/weixin_32759777/article/details/84555166',
         'https://blog.csdn.net/weixin_32759777/article/details/103832005',
         'https://blog.csdn.net/weixin_32759777/article/details/103468822',
         'https://blog.csdn.net/weixin_32759777/article/details/104841677',
         'https://blog.csdn.net/weixin_32759777/article/details/81986546',
         'https://blog.csdn.net/weixin_32759777/article/details/81411021',
         'https://blog.csdn.net/weixin_32759777/article/details/91359710',
         'https://blog.csdn.net/weixin_32759777/article/details/84565072',
         'https://blog.csdn.net/weixin_32759777/article/details/94141224',
         'https://blog.csdn.net/weixin_32759777/article/details/84569767',
         'https://blog.csdn.net/weixin_32759777/article/details/82723082',
         'https://blog.csdn.net/weixin_32759777/article/details/94793326',
         'https://blog.csdn.net/weixin_32759777/article/details/90205451',
         'https://blog.csdn.net/weixin_32759777/article/details/90760963',
         'https://blog.csdn.net/weixin_32759777/article/details/84671604',
         'https://blog.csdn.net/weixin_32759777/article/details/81410956',
         'https://blog.csdn.net/weixin_32759777/article/details/87921896',
         'https://blog.csdn.net/weixin_32759777/article/details/104859547',
         'https://blog.csdn.net/weixin_32759777/article/details/82747430',
         'https://blog.csdn.net/weixin_32759777/article/details/81911886',
         'https://blog.csdn.net/weixin_32759777/article/details/92772925',
         'https://blog.csdn.net/weixin_32759777/article/details/93190319',
         'https://blog.csdn.net/weixin_32759777/article/details/91923548',
         'https://blog.csdn.net/weixin_32759777/article/details/102714823',
         'https://blog.csdn.net/weixin_32759777/article/details/104163272',
         'https://blog.csdn.net/weixin_32759777/article/details/86908611',
         'https://blog.csdn.net/weixin_32759777/article/details/84636431',
         'https://blog.csdn.net/weixin_32759777/article/details/104098399',
         'https://blog.csdn.net/weixin_32759777/article/details/92385349',
         'https://blog.csdn.net/weixin_32759777/article/details/83793277',
         'https://blog.csdn.net/weixin_32759777/article/details/104729892',
         'https://blog.csdn.net/weixin_32759777/article/details/81707827',
         'https://blog.csdn.net/weixin_32759777/article/details/104576894',
         'https://blog.csdn.net/weixin_32759777/article/details/81588042',
         'https://blog.csdn.net/weixin_32759777/article/details/87776006',
         'https://blog.csdn.net/weixin_32759777/article/details/91923361',
         'https://blog.csdn.net/weixin_32759777/article/details/84787993',
         'https://blog.csdn.net/weixin_32759777/article/details/84586289',
         'https://blog.csdn.net/weixin_32759777/article/details/81453999',
         'https://blog.csdn.net/weixin_32759777/article/details/86748099',
         'https://blog.csdn.net/weixin_32759777/article/details/103841829',
         'https://blog.csdn.net/weixin_32759777/article/details/103831946',
         'https://blog.csdn.net/weixin_32759777/article/details/84565107',
         'https://blog.csdn.net/weixin_32759777/article/details/82723176',
         'https://blog.csdn.net/weixin_32759777/article/details/82767242',
         'https://blog.csdn.net/weixin_32759777/article/details/82723133',
         'https://blog.csdn.net/weixin_32759777/article/details/103298353',
         'https://blog.csdn.net/weixin_32759777/article/details/103617125',
         'https://blog.csdn.net/weixin_32759777/article/details/85204931',
         'https://blog.csdn.net/weixin_32759777/article/details/104530130',
         'https://blog.csdn.net/weixin_32759777/article/details/86304095',
         'https://blog.csdn.net/weixin_32759777/article/details/84998479',
         'https://blog.csdn.net/weixin_32759777/article/details/89601183',
         'https://blog.csdn.net/weixin_32759777/article/details/104833352',
         'https://blog.csdn.net/weixin_32759777/article/details/101027607',
         'https://blog.csdn.net/weixin_32759777/article/details/92794293',
         'https://blog.csdn.net/weixin_32759777/article/details/81812263',
         'https://blog.csdn.net/weixin_32759777/article/details/85238192',
         'https://blog.csdn.net/weixin_32759777/article/details/85011606',
         'https://blog.csdn.net/weixin_32759777/article/details/103304214',
         'https://blog.csdn.net/weixin_32759777/article/details/83539057',
         'https://blog.csdn.net/weixin_32759777/article/details/90317019',
         'https://blog.csdn.net/weixin_32759777/article/details/88945055',
         'https://blog.csdn.net/weixin_32759777/article/details/82555855',
         'https://blog.csdn.net/weixin_32759777/article/details/104199624',
         'https://blog.csdn.net/weixin_32759777/article/details/103708635',
         'https://blog.csdn.net/weixin_32759777/article/details/82120182',
         'https://blog.csdn.net/weixin_32759777/article/details/84778544',
         'https://blog.csdn.net/weixin_32759777/article/details/91921406',
         'https://blog.csdn.net/weixin_32759777/article/details/103930740',
         'https://blog.csdn.net/weixin_32759777/article/details/104800007',
         'https://blog.csdn.net/weixin_32759777/article/details/104024690',
         'https://blog.csdn.net/weixin_32759777/article/details/84820675',
         'https://blog.csdn.net/weixin_32759777/article/details/85248030',
         'https://blog.csdn.net/weixin_32759777/article/details/102909205',
         'https://blog.csdn.net/weixin_32759777/article/details/103942760',
         'https://blog.csdn.net/weixin_32759777/article/details/82555833',
         'https://blog.csdn.net/weixin_32759777/article/details/86664327',
         'https://blog.csdn.net/weixin_32759777/article/details/104766707',
         'https://blog.csdn.net/weixin_32759777/article/details/91968139',
         'https://blog.csdn.net/weixin_32759777/article/details/104719760',
         'https://blog.csdn.net/weixin_32759777/article/details/91938160',
         'https://blog.csdn.net/weixin_32759777/article/details/86748208',
         'https://blog.csdn.net/weixin_32759777/article/details/104949227',
         'https://blog.csdn.net/weixin_32759777/article/details/103831818',
         'https://blog.csdn.net/weixin_32759777/article/details/103831991',
         'https://blog.csdn.net/weixin_32759777/article/details/89309006',
         'https://blog.csdn.net/weixin_32759777/article/details/104092013',
         'https://blog.csdn.net/weixin_32759777/article/details/88966014',
         'https://blog.csdn.net/weixin_32759777/article/details/82555794',
         'https://blog.csdn.net/weixin_32759777/article/details/102868054',
         'https://blog.csdn.net/weixin_32759777/article/details/103203688',
         'https://blog.csdn.net/weixin_32759777/article/details/104405191',
         'https://blog.csdn.net/weixin_32759777/article/details/103841850',
         'https://blog.csdn.net/weixin_32759777/article/details/82120127',
         'https://blog.csdn.net/weixin_32759777/article/details/84990423',
         'https://blog.csdn.net/weixin_32759777/article/details/84635583',
         'https://blog.csdn.net/weixin_32759777/article/details/104833745',
         'https://blog.csdn.net/weixin_32759777/article/details/91926073',
         'https://blog.csdn.net/weixin_32759777/article/details/84393749',
         'https://blog.csdn.net/weixin_32759777/article/details/101212760',
         'https://blog.csdn.net/weixin_32759777/article/details/85783946',
         'https://blog.csdn.net/weixin_32759777/article/details/104774587',
         'https://blog.csdn.net/weixin_32759777/article/details/104688780',
         'https://blog.csdn.net/weixin_32759777/article/details/82915659',
         'https://blog.csdn.net/weixin_32759777/article/details/104493096',
         'https://blog.csdn.net/weixin_32759777/article/details/83505775',
         'https://blog.csdn.net/weixin_32759777/article/details/85156315',
         'https://blog.csdn.net/weixin_32759777/article/details/104854422',
         'https://blog.csdn.net/weixin_32759777/article/details/85223911',
         'https://blog.csdn.net/weixin_32759777/article/details/103399231',
         'https://blog.csdn.net/weixin_32759777/article/details/81633877',
         'https://blog.csdn.net/weixin_32759777/article/details/84590959',
         'https://blog.csdn.net/weixin_32759777/article/details/82431813',
         'https://blog.csdn.net/weixin_32759777/article/details/103831935',
         'https://blog.csdn.net/weixin_32759777/article/details/104570775',
         'https://blog.csdn.net/weixin_32759777/article/details/82555808',
         'https://blog.csdn.net/weixin_32759777/article/details/81539768',
         'https://blog.csdn.net/weixin_32759777/article/details/103952168',
         'https://blog.csdn.net/weixin_32759777/article/details/104026265',
         'https://blog.csdn.net/weixin_32759777/article/details/91877566',
         'https://blog.csdn.net/weixin_32759777/article/details/87199870',
         'https://blog.csdn.net/weixin_32759777/article/details/81482921',
         'https://blog.csdn.net/weixin_32759777/article/details/84567218',
         'https://blog.csdn.net/weixin_32759777/article/details/84990067',
         'https://blog.csdn.net/weixin_32759777/article/details/104190982',
         'https://blog.csdn.net/weixin_32759777/article/details/104892320',
         'https://blog.csdn.net/weixin_32759777/article/details/89311146',
         'https://blog.csdn.net/weixin_32759777/article/details/104646463',
         'https://blog.csdn.net/weixin_32759777/article/details/91725046',
         'https://blog.csdn.net/weixin_32759777/article/details/84994528',
         'https://blog.csdn.net/weixin_32759777/article/details/90177746',
         'https://blog.csdn.net/weixin_32759777/article/details/82723051',
         'https://blog.csdn.net/weixin_32759777/article/details/84667432',
         'https://blog.csdn.net/weixin_32759777/article/details/91920432',
         'https://blog.csdn.net/weixin_32759777/article/details/104983449',
         'https://blog.csdn.net/weixin_32759777/article/details/82555888',
         'https://blog.csdn.net/weixin_32759777/article/details/84998569',
         'https://blog.csdn.net/weixin_32759777/article/details/104005787',
         'https://blog.csdn.net/weixin_32759777/article/details/91919313',
         'https://blog.csdn.net/weixin_32759777/article/details/84998649',
         'https://blog.csdn.net/weixin_32759777/article/details/81952124',
         'https://blog.csdn.net/weixin_32759777/article/details/84998931',
         'https://blog.csdn.net/weixin_32759777/article/details/82555872',
         'https://blog.csdn.net/weixin_32759777/article/details/101987121',
         'https://blog.csdn.net/weixin_32759777/article/details/84952737',
         'https://blog.csdn.net/weixin_32759777/article/details/84581964',
         'https://blog.csdn.net/weixin_32759777/article/details/81455531',
         'https://blog.csdn.net/weixin_32759777/article/details/82155430',
         'https://blog.csdn.net/weixin_32759777/article/details/85050270',
         'https://blog.csdn.net/weixin_32759777/article/details/82431838',
         'https://blog.csdn.net/weixin_32759777/article/details/105025459',
         'https://blog.csdn.net/weixin_32759777/article/details/104656303',
         'https://blog.csdn.net/weixin_32759777/article/details/91920713',
         'https://blog.csdn.net/weixin_32759777/article/details/103841868',
         'https://blog.csdn.net/weixin_32759777/article/details/83116785',
         'https://blog.csdn.net/weixin_32759777/article/details/104532405',
         'https://blog.csdn.net/weixin_32759777/article/details/88970386',
         'https://blog.csdn.net/weixin_32759777/article/details/104268184',
         'https://blog.csdn.net/weixin_32759777/article/details/103937284',
         'https://blog.csdn.net/weixin_32759777/article/details/85156886',
         'https://blog.csdn.net/weixin_32759777/article/details/89068764',
         'https://blog.csdn.net/weixin_32759777/article/details/83507010',
         'https://blog.csdn.net/weixin_32759777/article/details/104098189',
         'https://blog.csdn.net/weixin_32759777/article/details/85028653',
         'https://blog.csdn.net/weixin_32759777/article/details/83781159',
         'https://blog.csdn.net/weixin_32759777/article/details/104515657',
         'https://blog.csdn.net/weixin_32759777/article/details/104352341',
         'https://blog.csdn.net/weixin_32759777/article/details/103692891',
         'https://blog.csdn.net/weixin_32759777/article/details/84566909',
         'https://blog.csdn.net/weixin_32759777/article/details/84788769',
         'https://blog.csdn.net/weixin_32759777/article/details/81703364',
         'https://blog.csdn.net/weixin_32759777/article/details/104069165',
         'https://blog.csdn.net/weixin_32759777/article/details/84886024',
         'https://blog.csdn.net/weixin_32759777/article/details/102636565',
         'https://blog.csdn.net/weixin_32759777/article/details/104202107',
         'https://blog.csdn.net/weixin_32759777/article/details/87776822',
         'https://blog.csdn.net/weixin_32759777/article/details/91046156',
         'https://blog.csdn.net/weixin_32759777/article/details/104202193',
         'https://blog.csdn.net/weixin_32759777/article/details/84998844',
         'https://blog.csdn.net/weixin_32759777/article/details/102892138',
         'https://blog.csdn.net/weixin_32759777/article/details/89316922',
         'https://blog.csdn.net/weixin_32759777/article/details/84839150',
         'https://blog.csdn.net/weixin_32759777/article/details/89887948',
         'https://blog.csdn.net/weixin_32759777/article/details/104994885',
         'https://blog.csdn.net/weixin_32759777/article/details/102531376',
         'https://blog.csdn.net/weixin_32759777/article/details/104811362',
         'https://blog.csdn.net/weixin_32759777/article/details/103382751',
         'https://blog.csdn.net/weixin_32759777/article/details/81458258',
         'https://blog.csdn.net/weixin_32759777/article/details/91513496',
         'https://blog.csdn.net/weixin_32759777/article/details/89372039',
         'https://blog.csdn.net/weixin_32759777/article/details/84522558',
         'https://blog.csdn.net/weixin_32759777/article/details/91930941',
         'https://blog.csdn.net/weixin_32759777/article/details/81514728',
         'https://blog.csdn.net/weixin_32759777/article/details/84666447',
         'https://blog.csdn.net/weixin_32759777/article/details/101215065',
         'https://blog.csdn.net/weixin_32759777/article/details/103841901',
         'https://blog.csdn.net/weixin_32759777/article/details/103478439',
         'https://blog.csdn.net/weixin_32759777/article/details/85008579',
         'https://blog.csdn.net/weixin_32759777/article/details/85321594',
         'https://blog.csdn.net/weixin_32759777/article/details/85011875',
         'https://blog.csdn.net/weixin_32759777/article/details/86170354',
         'https://blog.csdn.net/weixin_32759777/article/details/88999760',
         'https://blog.csdn.net/weixin_32759777/article/details/104486424',
         'https://blog.csdn.net/weixin_32759777/article/details/90900007',
         'https://blog.csdn.net/weixin_32759777/article/details/103322317',
         'https://blog.csdn.net/weixin_32759777/article/details/85088730',
         'https://blog.csdn.net/weixin_32759777/article/details/81566114',
         'https://blog.csdn.net/weixin_32759777/article/details/104818954',
         'https://blog.csdn.net/weixin_32759777/article/details/95043433',
         'https://blog.csdn.net/weixin_32759777/article/details/103934648',
         'https://blog.csdn.net/weixin_32759777/article/details/83656768',
         'https://blog.csdn.net/weixin_32759777/article/details/85164917',
         'https://blog.csdn.net/weixin_32759777/article/details/81911669',
         'https://blog.csdn.net/weixin_32759777/article/details/103460278',
         'https://blog.csdn.net/weixin_32759777/article/details/88852225',
         'https://blog.csdn.net/weixin_32759777/article/details/103459489',
         'https://blog.csdn.net/weixin_32759777/article/details/86715410',
         'https://blog.csdn.net/weixin_32759777/article/details/103740863',
         'https://blog.csdn.net/weixin_32759777/article/details/94185504',
         'https://blog.csdn.net/weixin_32759777/article/details/82747400',
         'https://blog.csdn.net/weixin_32759777/article/details/85054849',
         'https://blog.csdn.net/weixin_32759777/article/details/103890095',
         'https://blog.csdn.net/weixin_32759777/article/details/105315750',
         'https://blog.csdn.net/weixin_32759777/article/details/104272801',
         'https://blog.csdn.net/weixin_32759777/article/details/105316287',
         'https://blog.csdn.net/weixin_32759777/article/details/104883848',
         'https://blog.csdn.net/weixin_32759777/article/details/105264583',
         'https://blog.csdn.net/weixin_32759777/article/details/105363563',
         'https://blog.csdn.net/weixin_32759777/article/details/105365619',
         'https://blog.csdn.net/weixin_32759777/article/details/105365758',
         'https://blog.csdn.net/weixin_32759777/article/details/105366729',
         'https://blog.csdn.net/weixin_32759777/article/details/105385343',
         'https://blog.csdn.net/weixin_32759777/article/details/105386761',
         'https://blog.csdn.net/weixin_32759777/article/details/105390490',
         'https://blog.csdn.net/weixin_32759777/article/details/105391350',
         'https://blog.csdn.net/weixin_32759777/article/details/105411357',
         'https://blog.csdn.net/weixin_32759777/article/details/105405898',
         'https://blog.csdn.net/weixin_32759777/article/details/105392935',
         'https://blog.csdn.net/weixin_32759777/article/details/105391839',
         'https://blog.csdn.net/weixin_32759777/article/details/105989119',
         'https://blog.csdn.net/weixin_32759777/article/details/105983911',
         'https://blog.csdn.net/weixin_32759777/article/details/105971035',
         'https://blog.csdn.net/weixin_32759777/article/details/105967789',
         'https://blog.csdn.net/weixin_32759777/article/details/105952604',
         'https://blog.csdn.net/weixin_32759777/article/details/105323313',
         'https://blog.csdn.net/weixin_32759777/article/details/105929864',
         'https://blog.csdn.net/weixin_32759777/article/details/105920251',
         'https://blog.csdn.net/weixin_32759777/article/details/105910139',
         'https://blog.csdn.net/weixin_32759777/article/details/105876184',
         'https://blog.csdn.net/weixin_32759777/article/details/105874296',
         'https://blog.csdn.net/weixin_32759777/article/details/105873943',
         'https://blog.csdn.net/weixin_32759777/article/details/105857419',
         'https://blog.csdn.net/weixin_32759777/article/details/105842267',
         'https://blog.csdn.net/weixin_32759777/article/details/105841071',
         'https://blog.csdn.net/weixin_32759777/article/details/105839839',
         'https://blog.csdn.net/weixin_32759777/article/details/105838260',
         'https://blog.csdn.net/weixin_32759777/article/details/105834984',
         'https://blog.csdn.net/weixin_32759777/article/details/105812496',
         'https://blog.csdn.net/weixin_32759777/article/details/105806817',
         'https://blog.csdn.net/weixin_32759777/article/details/105805535',
         'https://blog.csdn.net/weixin_32759777/article/details/105774205',
         'https://blog.csdn.net/weixin_32759777/article/details/105744391',
         'https://blog.csdn.net/weixin_32759777/article/details/105738146',
         'https://blog.csdn.net/weixin_32759777/article/details/105727104',
         'https://blog.csdn.net/weixin_32759777/article/details/105711891',
         'https://blog.csdn.net/weixin_32759777/article/details/105686363',
         'https://blog.csdn.net/weixin_32759777/article/details/105684262',
         'https://blog.csdn.net/weixin_32759777/article/details/105675145',
         'https://blog.csdn.net/weixin_32759777/article/details/105674307',
         'https://blog.csdn.net/weixin_32759777/article/details/105661665',
         'https://blog.csdn.net/weixin_32759777/article/details/105661316',
         'https://blog.csdn.net/weixin_32759777/article/details/105657005',
         'https://blog.csdn.net/weixin_32759777/article/details/105652392',
         'https://blog.csdn.net/weixin_32759777/article/details/105650742',
         'https://blog.csdn.net/weixin_32759777/article/details/105638904',
         'https://blog.csdn.net/weixin_32759777/article/details/105635808',
         'https://blog.csdn.net/weixin_32759777/article/details/105634073',
         'https://blog.csdn.net/weixin_32759777/article/details/105594136',
         'https://blog.csdn.net/weixin_32759777/article/details/105630833',
        'https://blog.csdn.net/blogdevteam/article/details/90369522',
         'https://blog.csdn.net/weixin_32759777/article/details/105621114',
         'https://blog.csdn.net/weixin_32759777/article/details/105588190',
         'https://blog.csdn.net/weixin_32759777/article/details/105581258',
         'https://blog.csdn.net/weixin_32759777/article/details/105577532',
         'https://blog.csdn.net/weixin_32759777/article/details/105573195',
         'https://blog.csdn.net/weixin_32759777/article/details/105572910',
         'https://blog.csdn.net/weixin_32759777/article/details/105572204',
         'https://blog.csdn.net/weixin_32759777/article/details/105562579',
         'https://blog.csdn.net/weixin_32759777/article/details/105531237',
         'https://blog.csdn.net/weixin_32759777/article/details/105527791',
         'https://blog.csdn.net/weixin_32759777/article/details/105511669',
         'https://blog.csdn.net/weixin_32759777/article/details/105509412',
         'https://blog.csdn.net/weixin_32759777/article/details/105489132',
         'https://blog.csdn.net/weixin_32759777/article/details/105482089',
         'https://blog.csdn.net/weixin_32759777/article/details/105477699',
         'https://blog.csdn.net/weixin_32759777/article/details/105477678',
         'https://blog.csdn.net/weixin_32759777/article/details/105481443',
         'https://blog.csdn.net/weixin_32759777/article/details/105460111',
         'https://blog.csdn.net/weixin_32759777/article/details/105380273',
         'https://blog.csdn.net/weixin_32759777/article/details/105427316',
         'https://blog.csdn.net/weixin_32759777/article/details/105415615',
         'https://blog.csdn.net/weixin_32759777/article/details/105414459']
MY_USER_AGENT = [
    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
    "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)",
    "Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
    "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)",
    "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)",
    "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)",
    "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)",
    "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)",
    "Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6",
    "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070215 K-Ninja/2.1.1",
    "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/20080705 Firefox/3.0 Kapiko/3.0",
    "Mozilla/5.0 (X11; Linux i686; U;) Gecko/20070322 Kazehakase/0.4.5",
    "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Fedora/1.9.0.8-1.fc10 Kazehakase/0.5.6",
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20",
    "Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52",
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11",
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.71 Safari/537.1 LBBROWSER",
    "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; LBBROWSER)",
    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E; LBBROWSER)",
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 LBBROWSER",
    "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",
    "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; QQBrowser/7.0.3698.400)",
    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)",
    "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)",
    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)",
    "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",
    "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1",
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1",
    "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
    "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b13pre) Gecko/20110307 Firefox/4.0b13pre",
    "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0",
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11",
    "Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
]

Android_USER_AGENT = [
    'Mozilla/5.0 (Linux; Android 7.1.1; MI 6 Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/043807 Mobile Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/WIFI Language/zh_CN',
    'Mozilla/5.0 (Linux; Android 7.1.1; OD103 Build/NMF26F; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043632 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN',
    'Mozilla/5.0 (Linux; Android 6.0.1; SM919 Build/MXB48T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043632 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/WIFI Language/zh_CN',
    'Mozilla/5.0 (Linux; Android 5.1.1; vivo X6S A Build/LMY47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043632 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/WIFI Language/zh_CN',
    'Mozilla/5.0 (Linux; Android 5.1; HUAWEI TAG-AL00 Build/HUAWEITAG-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043622 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN',
    'Mozilla/5.0 (Linux; Android 7.0; FRD-AL10 Build/HUAWEIFRD-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/62.0.3202.84 Mobile Safari/537.36 MicroMessenger/6.7.3.1360(0x26070336) NetType/WIFI Language/zh_CN Process/appbrand0'
]

iPhone_USER_AGENT = [
    'Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69 MicroMessenger/6.6.1 NetType/4G Language/zh_CN',
    'Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_2 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C202 MicroMessenger/6.6.1 NetType/4G Language/zh_CN',
    'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_1 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B150 MicroMessenger/6.6.1 NetType/WIFI Language/zh_CN',
    'Mozilla/5.0 (iphone x Build/MXB48T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043632 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/WIFI Language/zh_CN'
]

import random
import requests
from bs4 import BeautifulSoup
import multiprocessing
import time

from selenium import webdriver

success_num = 0
CONSTANT = 0


def getProxyIp():
    global CONSTANT
    proxy = []
    for i in range(1, 3):
        print(i)
        header = {'User-Agent': random.choice(random.choice([MY_USER_AGENT, iPhone_USER_AGENT, Android_USER_AGENT])),
                  "Cookie": "BIDUPSID=0E57AEE9D3C3CB8B786EA9BAC4080126; PSTM=1579276370; BAIDUID=0E57AEE9D3C3CB8B051B6A35B938B179:FG=1; BD_UPN=123353; ispeed=1; ispeed_lsm=0; BDUSS=ZQUmlJSmg5UmR5Sk9OcWFtNHNzUU1hOG44d0M3dVF2eGpkT29Xb1hKTERtcDVlSVFBQUFBJCQAAAAAAAAAAAEAAAA2ENk0aGVhdmVuzuXJ2dKvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMMNd17DDXdeRE; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; COOKIE_SESSION=4_0_6_2_3_3_0_0_5_2_25_0_179616_0_0_0_1586524676_0_1586608537%7C9%232214113_27_1583631072%7C9; H_PS_645EC=d6fa3pOMn%2BRHnGXo6otnA1co353rMV21l%2F%2BG9li664So66IDrurFWzMaiIA; BD_HOME=1; H_PS_PSSID=1441_21087_31069_30826_31186_30904_31270_31228_30823_31085_31163_31195; sug=3; sugstore=0; ORIGIN=0; bdime=0"}
        r = requests.get('http://www.xicidaili.com/nt/{0}'.format(i), headers=header)

        html = r.text
        soup = BeautifulSoup(html)
        table = soup.find('table', attrs={'id': 'ip_list'})
        tr = table.find_all('tr')[1:]

        # 解析得到代理ip的地址，端口，和类型
        for item in tr:
            tds = item.find_all('td')
            print(tds[1].get_text())
            temp_dict = {}
            kind = tds[5].get_text().lower()
            # exit()

            if 'http' in kind:
                temp_dict['http'] = "http://{0}:{1}".format(tds[1].get_text(), tds[2].get_text())
            if 'https' in kind:
                temp_dict['https'] = "https://{0}:{1}".format(tds[1].get_text(), tds[2].get_text())

            proxy.append(temp_dict)
    return proxy

@jit
def brash(proxy_dict, url_data):
    header = {'User-Agent': random.choice(random.choice([MY_USER_AGENT, iPhone_USER_AGENT, Android_USER_AGENT]))}
    # header ={'Mozilla/5.0 (Linux; Android 4.4.2; 2014501 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 Html5Plus/1.0 (Immersed/25.0)'}
    try:

        r = requests.get(url_data, headers=header, proxies=proxy_dict, timeout=10)
    except Exception as e:
        pass  # CONSTANT +=1
    else:
        #         with open("log.txt", "a") as f:
        #             f.write(url_data + "  successful \n")
        print(url_data, "successful")
    time.sleep(0.5)
    return None


if __name__ == '__main__':
    i = 0
    # final = input()  # 输入数字代表要获取多少次代理ip
    u_i = -1
    url_list = url_l[2*len(url_l)//5:3*len(url_l)//5]
    # url_list =["https://blog.csdn.net/weixin_32759777/article/details/104859547"]
    # proxies = getProxyIp()
    # final = input()
    while True:
        # 获取代理ip网站上的前12页的ip
        # print CONSTANT
        chrome_options = webdriver.ChromeOptions()
        chrome_options.add_argument("--headless")
        browser = webdriver.Chrome(executable_path="/home/chenyang/accessCsdn-master/chromedriver",
                                   chrome_options=chrome_options)

        browser.set_page_load_timeout(1)
        for i in url_list:
            try:
                browser.get(i)
            except:
                pass
        browser.close()
        time.sleep(5)
